package com.zut.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zut.mapper.ClassorderMapper;
import com.zut.pojo.Classorder;
import com.zut.service.ClassorderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author classorder
 * @since 2021-06-06
 */
@Service
public class ClassorderServiceImpl extends ServiceImpl<ClassorderMapper, Classorder> implements ClassorderService {

    @Resource
    private ClassorderMapper classorderMapper;
    @Resource
    private ClassorderService classorderService;

    //展示已购买课时包信息
    @Override
    public List<Classorder> selectClassPro(Integer parid) {
        QueryWrapper<Classorder> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("parid",parid);
        List<Classorder> classorders = classorderMapper.selectList(queryWrapper);
        return classorders;
    }

    @Override
    public List<Classorder> selectAllClassPro() {
        List<Classorder> list = classorderService.list();
        return list;
    }
}
